package com.zany.login.action;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.ServletActionContext;


import com.zany.system.service.UserInfoService;
import com.zany.system.vo.UserInfoVO;
import com.zany.util.action.AbstractActionSupport;
import com.zany.util.action.SessionInfo;
import com.zany.util.ajax.AjaxTools;
import com.zany.util.json.JsonTools;

public class MainAction  extends AbstractActionSupport{

	private static final long serialVersionUID = -4184073680097509662L;
	private static Log logger = LogFactory.getLog(MainAction.class);
	private UserInfoVO userInfoVO = new UserInfoVO();
	private List<UserInfoVO> list = new ArrayList<UserInfoVO>();
	private UserInfoService userInfoService;
	
	public void getUserDetail() throws Exception{
		if(logger.isInfoEnabled()){logger.info("MainAction.getUserDetail()");}
		response = ServletActionContext.getResponse();
		userInfoVO.setUserCode(SessionInfo.getUserCode(request));
		userInfoVO = userInfoService.getUserInfoDetailTemp(userInfoVO);
		list.add(userInfoVO);
		AjaxTools.exAjax("{results:" + list.size() + ",ZANY:" + JsonTools.lstBeanToJson(list) + "}", response);
	}

	public void setSession(Map arg0) {
		// TODO Auto-generated method stub
	}
	public UserInfoService getUserInfoService() {
		return userInfoService;
	}
	public void setUserInfoService(UserInfoService userInfoService) {
		this.userInfoService = userInfoService;
	}

}
